﻿using Prism.Ioc;
using Prism.Regions;
using System.Windows;
using WpfKeyFrame.Views;

namespace WpfKeyFrame
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        protected override Window CreateShell()
        {
            var window = Container.Resolve<MainWindow>();
            window.Loaded += (sender, args) =>
            {
                var manager = Container.Resolve<IRegionManager>();
                manager.RequestNavigate("ContentRegion", "MainProcessWindow");  // 设置首页
            };
            return window;
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<MainProcessWindow>();
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            SplashScreen splashScreen = new SplashScreen("/Resourse/SplashScreen.png");
            splashScreen.Show(false, true);
            splashScreen.Close(new System.TimeSpan(0, 0, 1));
            base.OnStartup(e);
        }
    }
}
